package com.etcn.manager.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import com.etcn.manager.model.TUser;

@Repository("userDao")
public interface UserRepository extends CrudRepository<TUser, Integer>{
	TUser findById(Integer id);
	TUser findByUsername(String username);
	@Query("select user from TUser user where user.isDelete=false and  user.userType=?1 and user.username<>'admin'")
	Page<TUser> getUsersPageable(String userType,Pageable pageable);
	
}
